<template>
  <div>
    News
    <div>
      <button @click="toNews('JDG 3:0 REG','001')">JDG 3:0 REG</button>
      <button @click="toNews('二十大召开','002')">二十大召开</button>
      <button @click="toNews('期待RNG 3:2 T1','003')">期待RNG 3:2 T1</button>
      <RouterView></RouterView>
    </div>
  </div>
</template>

<script lang="ts">
import {defineComponent} from "vue";
export default defineComponent({
    name:"News",
})
</script>

<script lang="ts" setup>
import {useRouter} from "vue-router";
const router = useRouter()
const toNews = (title:string,id:string)=>{
    router.push({
        name:"newsItem",
        query:{
          title,
          id
        }
    })
}
</script>

<style scoped>

</style>